Skip to content

docs: blessed two-client pattern for dual-role BFF backends#101

Merged
windischb merged 1 commit into
developfrom
docs/bff-two-client-pattern
Jun 23, 2026
Merged

docs: blessed two-client pattern for dual-role BFF backends#101
windischb merged 1 commit into
developfrom
docs/bff-two-client-pattern

Conversation

@windischb

Copy link
Copy Markdown
Contributor

What

Documents the blessed pattern for a backend-for-frontend (BFF) that both brokers user login and acts machine-to-machine — it needs two modgud clients, not one.

Answers the AmZettel consumer request logged in Atlas (requests-amzettel-bff-single-credential). All three of their questions, verified against the current backend code:

  • Confidential urn:cocoar:otp redeem already worksExchangeNativeOtpAsync gates only on NativeGrants.Enabled + the gt:urn:cocoar:otp permission; there is no public-only / token_endpoint_auth_method enforcement. A server-side BFF may redeem natively with a confidential client.
  • Two-client split is the intended pattern — strict grant separation (R1/R2/R3) forbids one client holding both user-flow and client_credentials. So a dual-role BFF runs a login client + a separate SA-linked M2M client. Now written down.
  • Single mixed confidential client — declined by design (breaks client → one principal, the SA-managed read-only rule, and audit tooling). Not part of this doc change.

Changes

  • docs/integrate/native-apps.md — "Server-side BFF (confidential redeem)" note after the client-type step, spelling out the two-client split.
  • docs/admin/service-accounts.md — a "Dual-role BFF backends" tip under Strict grant separation, cross-linking the native-apps guidance.

Docs-only. No code changes.

🤖 Generated with Claude Code

A BFF that both brokers user login (server-side native-grant redeem) and
acts machine-to-machine (client_credentials) needs two modgud clients, not
one — strict grant separation forbids a single client holding both. Document
this as the intended pattern, and clarify that the native grants have no
public-only enforcement, so a server-side BFF may redeem them with a
confidential client.

- native-apps.md: server-side BFF (confidential redeem) note + two-client split
- service-accounts.md: dual-role BFF tip cross-linking the native-apps guidance

Answers the AmZettel consumer request (Atlas: requests-amzettel-bff-single-credential).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@windischb windischb merged commit 009da4e into develop Jun 23, 2026
5 checks passed
@windischb windischb deleted the docs/bff-two-client-pattern branch June 23, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant